package com.ccg.androidwebrtcclient

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Scaffold
import androidx.compose.material3.ShapeDefaults.Small
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import com.ccg.androidwebrtcclient.ui.theme.AndroidWebrtcClientTheme
import timber.log.Timber
import timber.log.Timber.DebugTree
import timber.log.Timber.Forest.plant

/**
 * @author : C4_雍和
 * 描述 :
 * 主要功能 :
 * 维护人员 : C4_雍和
 * date : 2025/9/23 14:23
 */
class MainActivity : ComponentActivity() {
    private val context = this

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Timber.e("onCreate")
        plant(DebugTree())
        enableEdgeToEdge()
        setContent {
            AndroidWebrtcClientTheme {
                Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
                    Column(
                        modifier = Modifier
                            .fillMaxSize()
                            .padding(innerPadding)
                    ) {
                        Button(onClick = {
                            val intent = Intent(context, TextTransmissionActivity::class.java)
                            startActivity(intent)
                        }) {
                            Text(text = "点对点文字传输")
                        }
                        Button(onClick = {
                            val intent = Intent(context, SmallFileTransmissionActivity::class.java)
                            startActivity(intent)
                        }) {
                            Text(text = "点对点小文件传输")
                        }
                        Button(onClick = {
                            val intent = Intent(context, LargeFileTransmissionActivity::class.java)
                            startActivity(intent)
                        }) {
                            Text(text = "点对点大文件传输")
                        }
                    }
                }
            }
        }
    }


}